<%= form_for [:admin,@event] do |f| %>
	<% if @event.errors.any? %>
	<div id="error_explanation">
		<h2><%= pluralize(@event.errors.count, "error") %></h2>
		<ul>
			<% @event.errors.full_message.each do |msg| %>
			<li><%= msg %></li>
			<% end %>
		</ul>
	</div>
	<% end %>
<div class="field">
	<%= f.label :id %><br/>
	<%= f.text_field :id %>
</div>
<div class="field">
	<%= f.label :イベント名 %><br/>
	<%= f.text_field :name %>
</div>
<div class="field">
	<%= f.label :種別 %><br/>
	<%= f.select(:type_name, {'スポーツ' => :sports, 'パフォーマンス' => :performance, '音楽' => :music, 'その他'=> :other},
	{:include_blank => 'えらんでね'})%>

</div>
<div class="field">
	<%= f.label :開始日時 %><br/>
	<%= f.datetime_select :start_time, :use_month_numbers => true, :start_year => Time.now.year%>
</div>
<div class="field">
	<%= f.label :終了日時 %><br/>
	<%= f.datetime_select :end_time, :use_month_numbers => true, :start_year => Time.now.year %>
</div>
<div class="field">
	<%= f.label :内容 %><br/>
	<%= f.text_field :description %>
</div>
<div class="field">
	<%= f.label :status %><br/>
	<%= f.select(:status,
				{'下書き'=> :draft, '公開'=> :published, '非公開'=> :secred}
	)%>
</div>
<div class="field">
	<%= f.label :point %><br/>
	<%= text_field_tag :pointx ,'', :id => 'posx'%>
	<%= text_field_tag :pointy ,'', :id => 'posy'%>
</div>
<div class="field">
	<%= f.label :パスワード %><br/>
	<%= f.password_field :passwd%>
</div>
<%= f.submit '登録'%>
<% end %>
    <div id="map" style="width: 300px; height: 300px" style="display:none;"></div>
<script type="text/javascript">
<!--
    if (GBrowserIsCompatible()) {
      var map = new GMap2($("#map")[0]);
      map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.setCenter(new GLatLng(38, 141), 8);
      map.disableDragging();
    }
    GEvent.addListener(map, 'click', function(overlay, point) {
      if (point) {
          $('#posx')[0].value = point.x;
          $('#posy')[0].value = point.y;
          map.openInfoWindow(point,
          document.createTextNode("openInfoWindow Test"));
          dispMap(0);
      }
    });
    function dispMap(isDisp) {
      if(isDisp == 0) {
        document.getElementById("map").style.display="block";
      } else {
        document.getElementById("map").style.display="none";
      }
    }
// -->
</script>